package com.hhd.flow.engine.vo;

import com.alibaba.fastjson.JSONArray;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class UserTask {
    private String id;
    private String type;
    private String taskName;
    private String taskKey;
    private ExecuteWay executeWay;
    private Integer executeThreshold;
    private String actionAuth;
    private boolean notify;
    private boolean manualSelectUser;
    private boolean autoComplete;
    private boolean mustSignature;
    private boolean addCountSign;
    private String addCountSignUsers;
    private String addCountSignUserNames;
    private JSONArray userConfigs;
    private String beforeEnterListeners;
    private String afterEnterListeners;
    private String beforeComplete;
    private String afterComplete;
    private String everyBeforeComplete;
    private String everyAfterComplete;
    private String pcView;
    private String pcAction;
    private String mobileView;
    private String mobileAction;

    private String countFrom;
    private String countFromUsername;
    private String countFromTaskDefinitionId;
    private String countFromTaskId;

    private String userMenuSelectReason;
    private boolean passNodeCannotWithdraw; // 经过此节点后, 不允许撤回
    private String passNodeCannotWithdrawMessage; // 不允许撤回的原因
    private String userTaskType; //节点类型, col协同节点, vouch 核定节点//协同节点就是普通的审批节点, vouch核定节点也没啥特殊的处理逻辑, 是给动态表单用的

    public enum ExecuteWay {
        single, multiCompetition, multiSequence, multi;
        public static ExecuteWay forName(String name) {
            for (ExecuteWay e : ExecuteWay.values()) {
                if (e.name().equals(name)) {
                    return e;
                }
            }
            return null;
        }
    }
}
